<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextListFormat Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextListFormat Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextListFormat class provides formatting information for
lists in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>

<p>Inherits <a href="qtextformat.html">QTextFormat</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtextlistformat.html#Style-enum">Style</a></b> { ListDisc, ListCircle, ListSquare, ListDecimal, ..., ListUpperRoman }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextlistformat.html#QTextListFormat">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextlistformat.html#QTextListFormat-2">__init__</a></b> (<i>self</i>, QTextListFormat)</li><li><div class="fn" />int <b><a href="qtextlistformat.html#indent">indent</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextlistformat.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextlistformat.html#numberPrefix">numberPrefix</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextlistformat.html#numberSuffix">numberSuffix</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextlistformat.html#setIndent">setIndent</a></b> (<i>self</i>, int&#160;<i>aindent</i>)</li><li><div class="fn" /><b><a href="qtextlistformat.html#setNumberPrefix">setNumberPrefix</a></b> (<i>self</i>, QString&#160;<i>np</i>)</li><li><div class="fn" /><b><a href="qtextlistformat.html#setNumberSuffix">setNumberSuffix</a></b> (<i>self</i>, QString&#160;<i>ns</i>)</li><li><div class="fn" /><b><a href="qtextlistformat.html#setStyle">setStyle</a></b> (<i>self</i>, Style&#160;<i>astyle</i>)</li><li><div class="fn" />Style <b><a href="qtextlistformat.html#style">style</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextListFormat class provides formatting information for
lists in a <a href="qtextdocument.html">QTextDocument</a>.</p>
<p>A list is composed of one or more items, represented as text
blocks. The list's format specifies the appearance of items in the
list. In particular, it determines the indentation and the style of
each item.</p>
<p>The indentation of the items is an integer value that causes
each item to be offset from the left margin by a certain amount.
This value is read with <a href="qtextlistformat.html#indent">indent</a>() and set with <a href="qtextlistformat.html#setIndent">setIndent</a>().</p>
<p>The style used to decorate each item is set with <a href="qtextlistformat.html#setStyle">setStyle</a>() and can be read with
the <a href="qtextlistformat.html#style">style</a>() function. The
style controls the type of bullet points and numbering scheme used
for items in the list. Note that lists that use the decimal
numbering scheme begin counting at 1 rather than 0.</p>
<p>Style properties can be set to further configure the appearance
of list items; for example, the <a href="qtextformat.html#Property-enum">ListNumberPrefix</a> and <a href="qtextformat.html#Property-enum">ListNumberSuffix</a> properties
can be used to customize the numbers used in an ordered list so
that they appear as (1), (2), (3), etc.:</p>
<pre class="cpp">
 <span class="type">QTextListFormat</span> listFormat;

 listFormat<span class="operator">.</span>setStyle(<span class="type">QTextListFormat</span><span class="operator">.</span>ListDecimal);
 listFormat<span class="operator">.</span>setNumberPrefix(<span class="string">"("</span>);
 listFormat<span class="operator">.</span>setNumberSuffix(<span class="string">")"</span>);

 cursor<span class="operator">.</span>insertList(listFormat);
</pre><hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Style-enum" />QTextListFormat.Style</h3><p>This enum describes the symbols used to decorate list items:</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListDisc</tt></td>
<td class="topAlign"><tt>-1</tt></td>
<td class="topAlign">a filled circle</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListCircle</tt></td>
<td class="topAlign"><tt>-2</tt></td>
<td class="topAlign">an empty circle</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListSquare</tt></td>
<td class="topAlign"><tt>-3</tt></td>
<td class="topAlign">a filled square</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListDecimal</tt></td>
<td class="topAlign"><tt>-4</tt></td>
<td class="topAlign">decimal values in ascending order</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListLowerAlpha</tt></td>
<td class="topAlign"><tt>-5</tt></td>
<td class="topAlign">lower case Latin characters in alphabetical
order</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListUpperAlpha</tt></td>
<td class="topAlign"><tt>-6</tt></td>
<td class="topAlign">upper case Latin characters in alphabetical
order</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListLowerRoman</tt></td>
<td class="topAlign"><tt>-7</tt></td>
<td class="topAlign">lower case roman numerals (supports up to 4999
items only)</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextListFormat.ListUpperRoman</tt></td>
<td class="topAlign"><tt>-8</tt></td>
<td class="topAlign">upper case roman numerals (supports up to 4999
items only)</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextListFormat" />QTextListFormat.__init__ (<i>self</i>)</h3><p>Constructs a new list format object.</p>


<h3 class="fn"><a name="QTextListFormat-2" />QTextListFormat.__init__ (<i>self</i>, <a href="qtextlistformat.html">QTextListFormat</a>)</h3><h3 class="fn"><a name="indent" />int QTextListFormat.indent (<i>self</i>)</h3><p>Returns the list format's indentation. The indentation is
multiplied by the <a href="qtextdocument.html#indentWidth-prop">QTextDocument.indentWidth</a>
property to get the effective indent in pixels.</p>
<p><b>See also</b> <a href="qtextlistformat.html#setIndent">setIndent</a>().</p>


<h3 class="fn"><a name="isValid" />bool QTextListFormat.isValid (<i>self</i>)</h3><p>Returns true if this list format is valid; otherwise returns
false.</p>


<h3 class="fn"><a name="numberPrefix" />QString QTextListFormat.numberPrefix (<i>self</i>)</h3><p>Returns the list format's number prefix.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qtextlistformat.html#setNumberPrefix">setNumberPrefix</a>().</p>


<h3 class="fn"><a name="numberSuffix" />QString QTextListFormat.numberSuffix (<i>self</i>)</h3><p>Returns the list format's number suffix.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qtextlistformat.html#setNumberSuffix">setNumberSuffix</a>().</p>


<h3 class="fn"><a name="setIndent" />QTextListFormat.setIndent (<i>self</i>, int&#160;<i>aindent</i>)</h3><p>Sets the list format's <i>indentation</i>. The indentation is
multiplied by the <a href="qtextdocument.html#indentWidth-prop">QTextDocument.indentWidth</a>
property to get the effective indent in pixels.</p>
<p><b>See also</b> <a href="qtextlistformat.html#indent">indent</a>().</p>


<h3 class="fn"><a name="setNumberPrefix" />QTextListFormat.setNumberPrefix (<i>self</i>, QString&#160;<i>np</i>)</h3><p>Sets the list format's number prefix to the string specified by
<i>numberPrefix</i>. This can be used with all sorted list types.
It does not have any effect on unsorted list types.</p>
<p>The default prefix is an empty string.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qtextlistformat.html#numberPrefix">numberPrefix</a>().</p>


<h3 class="fn"><a name="setNumberSuffix" />QTextListFormat.setNumberSuffix (<i>self</i>, QString&#160;<i>ns</i>)</h3><p>Sets the list format's number suffix to the string specified by
<i>numberSuffix</i>. This can be used with all sorted list types.
It does not have any effect on unsorted list types.</p>
<p>The default suffix is ".".</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qtextlistformat.html#numberSuffix">numberSuffix</a>().</p>


<h3 class="fn"><a name="setStyle" />QTextListFormat.setStyle (<i>self</i>, <a href="qtextlistformat.html#Style-enum">Style</a>&#160;<i>astyle</i>)</h3><p>Sets the list format's <i>style</i>.</p>
<p><b>See also</b> <a href="qtextlistformat.html#style">style</a>()
and <a href="qtextlistformat.html#Style-enum">Style</a>.</p>


<h3 class="fn"><a name="style" /><a href="qtextlistformat.html#Style-enum">Style</a> QTextListFormat.style (<i>self</i>)</h3><p>Returns the list format's style.</p>
<p><b>See also</b> <a href="qtextlistformat.html#setStyle">setStyle</a>() and <a href="qtextlistformat.html#Style-enum">Style</a>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>